﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Insert_Account : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public void AddAcount(object s, EventArgs e)
    {
        Acount a = new Acount();
        AcountBOL aBOL = new AcountBOL();

        try
        {
            a.Username = txtUsername.Text;
            a.Pass = txtPass.Text;
            a.Identification = txtIdentification.Text;
            a.Dateregistry = Convert.ToDateTime(txtDateRegister.Text);
            a.Acounttype = txtAcountType.Text;

            int result = aBOL.insertAcount(a);
            if (result > 0)
            {
                Label7.Text = "Insert record is successful!";
            }
            else
                Label7.Text = "Insert record is error";
        }
        catch (Exception ex)
        {
            Label7.Text = ex.Message;
        }
        finally
        {
            a = null;
            aBOL = null;
        }
    }
}